/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.DocProject.DocSites
{
	public abstract class QueryOperation : QueryExpression
	{
		#region Public Properties
		public QueryOperator Operator
		{
			get
			{
				return op;
			}
			set
			{
				op = value;
			}
		}

		public abstract IEnumerable<QueryExpression> Operands { get; }

		public abstract int OperandCount { get; }

		public abstract bool MissingOperand { get; }
		#endregion

		#region Private / Protected
		private QueryOperator op;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="QueryOperation" /> class for derived classes.
		/// </summary>
		protected QueryOperation(QueryOperator op)
		{
			this.op = op;
		}

		/// <summary>
		/// Constructs a new instance of the <see cref="QueryOperation" /> class for derived classes.
		/// </summary>
		protected QueryOperation(QueryOperator op, QueryExpression parent)
			: base(parent)
		{
			this.op = op;
		}
		#endregion

		#region Methods
		public abstract void AppendOperand(QueryExpression nextOperand);
		#endregion
	}
}
